import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const selectedTitle = localStorage.getItem('selectedTitle')

export default new Vuex.Store({
  state: {
    selectedTitle: selectedTitle || '',
  },
  mutations: {
    SET_SELECTEDTITLE(state, val) {
      state.selectedTitle = val
    },
  },
  actions: {
    // 当前目录树选择的节点
    ON_SELECTEDTITLE(context, val) {
      context.commit('SET_SELECTEDTITLE', val)
    },
  },
  modules: {},
})
